<template>
	<div class="account">
		<right-nav :parentName='"账号管理"' :childName='"我的账号"'></right-nav>
		<div class="right-box">
			<div class="box-item">
				<div class="box-title">个人资料</div>
				<div class="box-content">
					<table>
						<tbody>
							<tr>
								<td class="item-title">用户名：</td>
								<td class="item-content pl10">{{userInfo.userName}}</td>
							</tr>
							<!--<tr>
								<td class="item-title">账户编号：</td>
								<td class="item-content pl10">18888888888</td>
								<td class="pl20">
									<a class="blue item-btn">绑定</a>
								</td>
							</tr>-->
							<tr>
								<td class="item-title">真实姓名：</td>
								<td class="item-content pl10">{{userInfo.userName}}</td>
								<td class="pl20">
									<a class="blue item-btn">编辑</a>
								</td>
							</tr>
							<tr>
								<td class="item-title">邮箱：</td>
								<td class="item-content pl10">{{userInfo.email}}</td>
								<td class="pl20">
									<a class="blue item-btn">绑定</a>
									<a class="blue item-btn" style="display: none;">更换</a>
								</td>
							</tr>
							<tr>
								<td class="item-title">手机：</td>
								<td class="item-content pl10">{{userInfo.telephone}}</td>
								<td class="pl20">
									<a class="blue item-btn">绑定</a>
									<a class="blue item-btn" style="display: none;">更换</a>
								</td>
							</tr>
							<tr>
								<td class="item-title">注册时间：</td>
								<td class="item-content pl10">{{getTime(userInfo.gmtCreated)}}</td>
							</tr>
							<tr>
								<td class="item-title">最后登录时间：</td>
								<td class="item-content pl10">{{getTime(userInfo.lastLoginTime)}}</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import RightNav from '@/components/right-nav'
	export default {
		components: {
			RightNav
	    },
		
		data(){
			return{
				userInfo: {},
			}
		},
		created(){
			this.$bus.emit('activeEvent','account');
			this.userInfo = this.$session.getItem('user');
		},
		methods: {
			getTime: function(str){
				let time = this.$moment(str).format('YYYY-MM-DD HH:mm:ss')
				return time
			},
		}
	}
</script>

<style scoped="scoped" lang="less">
	.account{
		.right-box{
		    padding: 18px;
			border: 1px solid rgb(221, 221, 221);
			.box-item{
				.box-title{
				    border-bottom: 1px solid rgb(221, 221, 221);
    				line-height: 2;
				}
				.box-content{
				    margin: 10px 0 20px;
				    .item-title{
			    	    width: 95px;
    					text-align: left;
				    }
				    .item-content{
				    	min-width: 135px;
				    }
				}
				.box-content > table td{
				    line-height: 2;
				}
			}
		}
	}
</style>